package com.lollipop.ucenter.web;

import com.lollipop.ucenter.rpc.api.ResourceService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

@RestController
@RequestMapping("/resource")
public class ResourceController {

    @Autowired
    ResourceService resourceService;

    @RequestMapping("/role/{id}")
    public Set<String> findRoleResources(@PathVariable("id") String roleId) {
        return resourceService.findResourcesByRoleId(roleId);
    }
}
